<template>
	<view>
		<u-navbar bgColor="transparent" leftIconColor="#fff" title="" autoBack></u-navbar>
		<view class="content">
			<view class="bg"></view>
			<view class="user-info">
				<image class="user-icon" :src="redParkInfo.currentUser.avatar||avatar" />
				<view class="right">
					<view class="nick">
						<view class="nick-text">{{redParkInfo.currentUser.nick}}</view>
						<text>发出的红包</text>
						<view class="nick-label">拼</view>
					</view>
					<view class="type">【{{redParkInfo.payType}}】红包</view>
				</view>
			</view>
			<view class="remark-box">
				<view class="remark">{{redParkInfo.remark}}</view>
				<view class="price red">
					<text>34.00</text>
					<text class="unit">元</text>
				</view>
				<view class="wallet">
					<text>已存入【{{redParkInfo.payType}}】钱包</text>
					<u-icon name="arrow-right" color="#333" size="30rpx"></u-icon>
				</view>
			</view>
		</view>
		<view class="content red-parket">
			<view class="tips" v-if="redParkInfo.groupId">{{redParkInfo.count}}个红包共200{{redParkInfo.payType}}，6秒被抢光</view>
			<view class="user-red" v-for="(item,index) in 1" :key="index">
				<view class="user-red-left">
					<image class="avatar" :src="redParkInfo.currentUser.avatar||avatar"/>
					<view>
						<view>王大宝</view>
						<view class="date">2024-02-12 10:21:31</view>
					</view>
				</view>
				<view class="price">
					<text>34.00</text>
					<text class="unit">元</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import { ref, onMounted, onUnmounted } from "../../../adapter-vue";
	import { onLoad } from "@dcloudio/uni-app";
	import avatar from "../../../assets/icon/head.png";
	let redParkInfo = ref({})
	onLoad((options : any) => {
		redParkInfo.value = JSON.parse(options.redParkInfo)
	})
</script>

<style lang="scss" scoped>
	.bg {
		width: 750rpx;
		height: 278rpx;
		background: #FFFFFF;
		border-radius: 0px 0px 50% 50%;
		background: linear-gradient(90deg, #FA3121 0%, #FC7844 100%);
	}

	.user-info {
		display: flex;
		justify-content: center;
		margin-top: 40rpx;

		.user-icon {
			width: 80rpx;
			height: 80rpx;
			border-radius: 100%;
			margin-right: 10rpx;
		}

		>view {
			max-width: 80%;

			.nick {
				display: flex;
				align-items: center;

				.nick-text {
					max-width: 60%;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
					font-weight: bold;

				}

				.nick-label {
					padding: 2rpx 8rpx;
					border: 1px solid #FA3121;
					color: #FA3121;
					font-size: 22rpx;
					margin-left: 10rpx;
					border-radius: 6rpx;
				}
			}

			.type {
				color: #888;
			}
		}
	}

	.content {
		background: #FFFFFF;
	}

	.remark-box {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		margin-top: 40rpx;

		.remark {
			color: #999;
		}

		
	}
	.price {
		
		font-weight: bold;
		font-size: 60rpx;
		margin: 20rpx 0;
	}
	.red{
		color: #FA3121;
	}
	.unit{
		font-size: 24rpx;
	}
	.wallet{
		display: flex;
		align-items: center;
		padding-bottom: 30rpx;
	}
	.red-parket{
		padding: 24rpx;
		margin-top: 24rpx;
	}
	.tips{
		color: #999;
	}
	.user-red{
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 20rpx;
		.avatar{
			width: 80rpx;
			height: 80rpx;
			border-radius: 100%;
			margin-right: 10rpx;
		}
		.user-red-left{
			display: flex;
			align-items: center;
		}
		.price{
			font-size: 36rpx;
		}
		.date{
			color:#999;
			margin-top: 5rpx;
		}
	}
</style>